package code07_面向对象;

public class Test11_对象的初始化顺序 {
	public static void main(String[] args) throws ClassNotFoundException {
		User u1 = new User();
		// User u2 = new User();

		// System.out.println(User.hobby);
		// Class.forName("code07_面向对象.User"); // 加载指定的类
		
		u1.a();
		User.b();
	}
}

class User {
	String name = "张三"; // 实例属性
	static String hobby = "编程"; // 静态属性

	public void a() {
		System.out.println("实例方法...");
	}

	public static void b() {
		System.out.println("静态方法...");
	}

	public User() {
		System.out.println("构造方法...");
	}

	{
		System.out.println("代码块....."+name);
	}

	static {
		System.out.println("静态代码块....");
	}

}
